package com.heima.admin.controller.v1;

import com.heima.apis.wemedia.IWemediaClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author
 * @date 2023/08/02
 */
@RestController
@RequestMapping("/api/v1/sensitive")
public class AdminSensitiveController {
    @Autowired
    private IWemediaClient iApWemedia;

    //查询
    @PostMapping("/list")
    private ResponseResult list(@RequestBody SensitiveDto sensitiveDto){
        return iApWemedia.listSensitive(sensitiveDto);
    }
    //删除
    @DeleteMapping("/del/{id}")
    private ResponseResult delete(@PathVariable("id") Integer id){
        return iApWemedia.deleteSensitive(id);
    }
    //新增
    @PostMapping("/save")
    private ResponseResult insert(@RequestBody WmSensitive wmSensitive){
        return iApWemedia.insertSensitive(wmSensitive);
    }
    //修改
    @PostMapping("update")
    private ResponseResult update(@RequestBody WmSensitive wmSensitive){
        return iApWemedia.updateSensitive(wmSensitive);
    }
}
